<?php

namespace WidgetAdminBalk\Model;

class Index {
    public function isAdmin() {
        $dbSql = "SELECT 1 FROM persoonbeheer WHERE idpersoon=:idpersoon";
        try {
            $dbStmt = \Db::GET()->prepare($dbSql);
            $dbStmt->execute([':idpersoon'=>$_SESSION['persoonid']]);
            if ($dbStmt->rowCount() == 0) {
                return false;
            } else {
                return true;
            }            
        } catch (PDOException $ex) {

        }
    }
}
